package com.technology.education.data.model

import com.technology.education.ext.formatTimeMin

/**
 * 用户信息
 */
data class UserInfoModel(
    var alipayName: String?,
    var alipayNo: String?,
    var avatar: String,
    val balanceDuration: Int,
    val balanceMoney: Double,
    val balancePoints: Int,
    var depositMoney: String,
    /**
     * 保证金状态 0未缴纳 1已缴纳
     */
    var depositState: String,
    val id: String,
    val inviteCode: String,
    val memberType: String,
    val mobile: String,
    val name: String,
    /**
     * 认证状态 -1未认证 0审核中 1认证通过 2认证审核失败
     */
    var certState: String,
    val nickname: String,
    val openid: String?,
    val servicePhone: String?,
    val depositRule: String?,//	保证金规则描述
) {
    val depositStateStr: String get() = if (depositState == "0") "未缴纳" else "已缴纳"

    val durationStr: String get() = formatTimeMin(balanceDuration)

    val certString: String
        get() = when (certState) {
            "-1" -> "未认证"
            "0" -> "审核中"
            "1" -> "认证通过"
            "2" -> "认证审核失败"
            else -> ""
        }
}